﻿package com.ease.model.criteria
{
	import com.ease.common.enums.ValuableEnum;
	import com.ease.lang.Enum;
	import com.ease.lang.EnumConstants;
	import com.ease.model.criteria.CriteriaType;

	[Bindable]
	[RemoteClass(alias="com.ease.model.criteria.CriteriaType")]

	public class CriteriaType extends Enum
	{
		/* static init */
		{ initEnum(CriteriaType); }

		/* Constants */
		public static const Ignore:CriteriaType = new CriteriaType("Ignore", 0);
		public static const Positive:CriteriaType = new CriteriaType("Positive", 10);
		public static const PrimaryKey:CriteriaType = new CriteriaType("PrimaryKey", 11);
		public static const ForeignKey:CriteriaType = new CriteriaType("ForeignKey", 12);
		public static const Equal:CriteriaType = new CriteriaType("Equal", 21);
		public static const NotEqual:CriteriaType = new CriteriaType("NotEqual", 22);
		public static const Like:CriteriaType = new CriteriaType("Like", 23);
		public static const Greaterthan:CriteriaType = new CriteriaType("Greaterthan", 24);
		public static const Lessthan:CriteriaType = new CriteriaType("Lessthan", 25);
		public static const LessthanOrEqual:CriteriaType = new CriteriaType("LessthanOrEqual", 26);
		public static const GreaterthanOrEqual:CriteriaType = new CriteriaType("GreaterthanOrEqual", 27);
		public static const In:CriteriaType = new CriteriaType("In", 30);
		public static const IsNull:CriteriaType = new CriteriaType("IsNull", 31);
		public static const IsNotNull:CriteriaType = new CriteriaType("IsNotNull", 32);
		public static const Between:CriteriaType = new CriteriaType("Between", 30);
		public static const NativeSql:CriteriaType = new CriteriaType("NativeSql", 40);

		private var _value:int;

		/*public*/ function CriteriaType(name:String=null ,value:int=0) {
			super.name = name;
			this._value = value;
		}

		public function get value():int  { return this._value; }

		/* constant query */
		public static function getEnumConstants():Array {
			return Enum.getEnumConstants(CriteriaType);
		}

		public static function get(constantName:String, caseSensitive:Boolean = false):CriteriaType {
			return CriteriaType(Enum.get(CriteriaType, constantName, caseSensitive));
		}
	}
}